﻿// FindPathDialog.cpp: 实现文件
//

#include "pch.h"
#include "SchoolGuide40.h"
#include "FindPathDialog.h"
#include "afxdialogex.h"
#include "MainFrm.h"
#include "SchoolGuide40View.h"

extern fstream runlog;
// FindPathDialog 对话框

IMPLEMENT_DYNAMIC(FindPathDialog, CDialogEx)

FindPathDialog::FindPathDialog(CWnd* pParent /*=nullptr*/)
	: CDialogEx(IDD_FINDPATH, pParent)
{ 	
	CMainFrame* pFrame = (CMainFrame*)AfxGetMainWnd();
	//获得视图类对象指针
	CSchoolGuide40View* pView = (CSchoolGuide40View*)pFrame->GetActiveView();

	for (int i = 0; i < pView->HustMap.vPNumber.size(); i++)
	{
		all_pname.push_back(pView->HustMap.vPNumber[i].getname());
		//runlog << all_pname[i];
	}

}

FindPathDialog::~FindPathDialog()
{
}

void FindPathDialog::DoDataExchange(CDataExchange* pDX)
{
	CComboBox* chooseBox1 = (CComboBox*)GetDlgItem(IDC_COMBO1);
	CComboBox* chooseBox2 = (CComboBox*)GetDlgItem(IDC_COMBO2);
	//CString strFont[5] = { _T("宋体"),_T("楷体"),_T("仿宋"),_T("黑体"),_T("华文细黑") };
	for (size_t i = 0; i < all_pname.size(); i++)
	{
		chooseBox1->InsertString(i, all_pname[i].c_str());
		chooseBox2->InsertString(i, all_pname[i].c_str());
	}
	runlog << "size======" << all_pname.size() << endl;

	//获得EDIT
	CEdit* pBoxOne;
	pBoxOne = (CEdit*)GetDlgItem(IDC_EDIT2);
	//赋值
	pBoxOne->SetWindowText(_T("该部分功能未实现。\r\n请使用右键设置起点-终点。"));
	CDialogEx::DoDataExchange(pDX);
}


BEGIN_MESSAGE_MAP(FindPathDialog, CDialogEx)
	ON_CBN_SELCHANGE(IDC_COMBO1, &FindPathDialog::OnCbnSelchangeCombo1)
	ON_CBN_EDITCHANGE(IDC_COMBO2, &FindPathDialog::OnCbnEditchangeCombo2)
END_MESSAGE_MAP()


// FindPathDialog 消息处理程序

//*****输入设置起点文本框
void FindPathDialog::OnCbnSelchangeCombo1()
{
	// TODO: 在此添加控件通知处理程序代码
	
}

//****终点
void FindPathDialog::OnCbnEditchangeCombo2()
{
	// TODO: 在此添加控件通知处理程序代码

}
